#include "widget.h"
#include "ui_widget.h"

Widget::Widget(QWidget *parent) :
    QWidget(parent),
    ui(new Ui::Widget)
{
    ui->setupUi(this);
    timer = new QTimer(this);
    desktop=QApplication::desktop();
    timer->start(FPS);
    timeshow();
    connect(timer,SIGNAL(timeout()),this,SLOT(timeshow()));
    S_width=desktop->width();
    S_height=desktop->height();

    //this->setGeometry(S_width/2-250,S_height/2-50,500,100);
    setGeometry(0,0,S_width,S_height);
}
void Widget::timeshow()
{

    time=QDateTime::currentDateTime();
    string=time.toString("yyyy-MM-dd hh:mm:ss ddd");
    ui->label->setText(string);
    update();
}
Widget::~Widget()
{
    delete ui;
}
